package com.combetter.changxing.bindingconfig;

import android.databinding.BindingAdapter;
import android.support.v7.widget.RecyclerView;

import com.combetter.changxing.collections.LayoutManagers;

/**
 * Created by Mark.fan on 2018/5/14.
 */

public class BindingLayoutManagerConfig {
    /**
     * 绑定布局方式属性
     * @param recyclerView
     * @param layoutManagerFactory
     */
    @BindingAdapter("layoutManager")
    public static void setLayoutManager(RecyclerView recyclerView, LayoutManagers.LayoutManagerFactory layoutManagerFactory) {
        recyclerView.setLayoutManager(layoutManagerFactory.create(recyclerView));
    }
}
